#include <iostream>
#include <string>
#include <stack>
using namespace std;


struct num{
	int number;
	char c;
};


int main(){
	stack<num> sta;
	num ans;
	ans.c = '+';
	ans.number = 0;
	sta.push(ans);
	string s;
	cin>>s;
	s = "0+"+s+"+0";
	ans.c = '+';
	ans.number = s[0]-'0';
	for(int i=1;i<s.length();){
		if(s[i] == '+'){
			if(s[i+1] == '('){
				sta.push(ans);
				ans.c = '+';
				ans.number = s[i+2]-'0';
				i += 3;
			}
			else if(s[i+2] == '*'){
				sta.push(ans);
				ans.c = '+';
				ans.number = s[i+1]-'0';
				i += 2;
			}
			else{
				ans.number += s[i+1]-'0';
				i += 2;
			}
		}
		else if(s[i] == '*'){
			if(s[i-2] == '('){
				num a;
				a.c = ans.c;
				a.number = 0;
				ans.c = '+';
				sta.push(a);
			}
			if(s[i+1] == '('){
				sta.push(ans);
				ans.c = '*';
				if(s[i+2] == '('){
					ans.c = '+';
					num a;
					a.number = 0;
					a.c = '*';
					sta.push(a);
					i++;
				}
				while(s[i+2] == '('){
					num a;
					a.c = '+';
					a.number = 0;
					sta.push(a);
					i++;
				}
				ans.number = s[i+2]-'0';
				i += 3;
			}
			else if(s[i+2] == '+'){
				ans.number *= s[i+1]-'0';
				num a=sta.top();
				sta.pop();
				ans.number += a.number;
				ans.c = a.c;
				i += 2;
			}
			else{
				ans.number *= s[i+1]-'0';
				i += 2;
			}
			if(s[i] == ')'){
				num a=sta.top();
				sta.pop();
				if(ans.c == '+'){
					ans.number += a.number;
					ans.c = a.c;
				}
				else{
					ans.number *= a.number;
					ans.c = a.c;
				}
			}
		}
		else{
			if(ans.c == '*'){
				num a=sta.top();
				sta.pop();
				ans.number *= a.number;
				ans.c = a.c;
				if(s[i+1] == '+'){
					a = sta.top();
					sta.pop();
					ans.number += a.number;
					ans.c = a.c;
				}
				i++;
			}
			else if(s[i+1] == '*'){
				i++;
			}
			else{
				num a=sta.top();
				sta.pop();
				ans.number += a.number;
				ans.c = a.c;
				i++;
			}
		}
	}
	while(!sta.empty()){
		num a=sta.top();
		sta.pop();
		if(ans.c == '+'){
			ans.number += a.number;
			ans.c = a.c;
		}
		else{
			ans.number *= a.number;
			ans.c = a.c;
		}
	}
	cout<<ans.number;
	return 0;
}

//2*(((9+1)+1)+1)
//3*(2+3+4)*4+3*(2*3+2)+(2*3)*5+(2*4)*(5*6)
